
import { requestInterceptors, responseInterceptors } from './interceptors.js'
import { http } from 'uview-plus'

const initRequest = (app) => {
    http.setConfig((defaultConfig) => {
        defaultConfig.baseURL = import.meta.env.VITE_BASE_URL
        defaultConfig.timeout = 10000
        defaultConfig.custom = {
            loading: true
        }
        return defaultConfig
    })
    requestInterceptors(app)
    responseInterceptors(app)
}

export { initRequest }